﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.Core.Entities
{
	public class News : BaseEntity
	{
		[StringLength(100)]
        [Required]
		public string Title { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime Date { get; set; }

        [DisplayName("Product")]
        public byte ProductType { get; set; }
        public byte MinAccessLevel { get; set; }

		[StringLength(1000)]
        //[RegularExpression(@"^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$", ErrorMessage = "Not valid url")]
		public string ExternalUrl { get; set; }
		[StringLength(100)]
		public string Tooltip { get; set; }

        public virtual ICollection<NewsProduct> Products { get; set; }
	}
}
